package cn.xuxiao;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class ApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {

    @Override
    public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
        System.out.println("自定义ApplicationReadyEvent的事件监听器 property:"+applicationReadyEvent
                .getApplicationContext()
                .getEnvironment()
                .getProperty("property"));
    }
}
